package com.spring.housing.controller.userInfo;

import com.spring.housing.acceptType.PageParams;
import com.spring.housing.returnType.CommenResult;
import com.spring.housing.returnType.PageType;
import com.spring.housing.service.userInfoService.NewsInfoServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class Infos {
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    NewsInfoServer newsInfoServer;

    @PostMapping("home/newsInfo")
    public CommenResult<PageType<Map<String,Object>>> newsInfo(@RequestBody PageParams params) {
        return newsInfoServer.newsInfo(params);
    }
    @PostMapping("/ofckb/query")
    public CommenResult<PageType<Map<String,Object>>> ofckbInfo(@RequestBody PageParams params) {
        return newsInfoServer.ofckbInfo(params);
    }
    //接单
    @PostMapping("/ofckb/acceptOder")
    public CommenResult acceptOder(@RequestBody PageParams page) {
        return  newsInfoServer.acceptOder(page);
    }

}
